//
//  UIButton+Extension.swift
//  SJWeiboSwift
//
//  Created by app;e on 15/10/8.
//  Copyright © 2015年 world. All rights reserved.
//

import UIKit

extension UIButton{
    
    convenience init(title:String,imageName:String,titleSize:CGFloat,titleColor:UIColor = UIColor.darkGrayColor()){
        self.init()
        setTitle(" "+title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(titleSize)
    
    }
    
    convenience init(title:String,titleSize:CGFloat,titleColor:UIColor = UIColor.whiteColor(),bgColor:UIColor = UIColor.brownColor()){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(titleSize)
        backgroundColor = bgColor
    }
}
